﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Diagnostics.Contracts;
using HeapSpecSupport;
using SimpleIR;

namespace Evaluator.EvalState
{
	/// <summary>
	/// Class that is a super class for all the values -- these types are all immutable and can be shared without worry.
	/// </summary>
	internal abstract class EValue
	{
		protected readonly IRType m_valuetype;

		protected EValue(IRType valuetype)
		{
			Contract.Requires(valuetype != null);

			this.m_valuetype = valuetype; 
		}

		internal IRType TypeOfValue
		{ get { return this.m_valuetype; } }
	}

	/// <summary>
	/// Class that is a super class for values that can be stored in heap memory and structs  -- these types are all immutable and can be shared without worry.
	/// </summary>
	internal abstract class EMemoryValue : EValue
	{
		protected EMemoryValue(IRType mvtype)
			: base(mvtype)
		{ ;}
	}
}